
/**
 * 初始化日常用语JS函数
 */
function initYongYu(nodeid){	
	/**
	$("#changyongyongyu").change(function(){
							if(parseInt($(this).val())  != 0){
								var text = $(this).find("option:selected").text();
								if($("#yijian").text()==''){
									$("#yijian").text($("#yijian").text()+text);
								}else{
									$("#yijian").text($("#yijian").text()+','+text);
								}
								if(text == "退回"){
									$("input[name=path]").attr("checked",'0');
								}else{
									
								}
							}					 
	});
	var _array;
	if(typeof(nodeid)   ==   'undefined'){
		_array = ["请选择","阅","同意","办理完毕","退回"];
		if($("#changyongyongyu").length > 0){		
			for(var i = 0;i<_array.length;i++){
				$("#changyongyongyu").append("<option value='"+i+"'>"+_array[i]+"</option>");   	
			}			
			$("#changyongyongyu").change(function(){
				if(parseInt($(this).val())  != 0){
					var text = $(this).find("option:selected").text();
					$("#yijian").text(text);
				}					 
			});
		}
	}else{
		var url = Ext.get('basePath').getValue()+'tjsinfo/tjsoa/system/changyongyu.do?nodeId='+nodeid;
		 $.get(url,function(data){		
				if("," == data){
					_array = ["请选择","阅","同意","办理完毕","退回"];
					if($("#changyongyongyu").length > 0){		
						for(var i = 0;i<_array.length;i++){
							$("#changyongyongyu").append("<option value='"+i+"'>"+_array[i]+"</option>");   	
						}			
						$("#changyongyongyu").change(function(){
							if(parseInt($(this).val())  != 0){
								var text = $(this).find("option:selected").text();
								$("#yijian").text(text);
							}					 
						});
					}
				}else{
					_array = data.split(",");
					if($("#changyongyongyu").length > 0){
						$("#changyongyongyu").append("<option value='0'>请选择</option>");
						for(var i = 0;i<_array.length;i++){
							if("" != _array[i]){
								$("#changyongyongyu").append("<option value='"+i+"'>"+_array[i]+"</option>");
							}							   	
						}			
						$("#changyongyongyu").change(function(){
							if(parseInt($(this).val())  != 0){
								var text = $(this).find("option:selected").text();
								if($("#yijian").text()==''){
									$("#yijian").text($("#yijian").text()+text);
								}else{
									$("#yijian").text($("#yijian").text()+','+text);
								}
								if(text == "退回"){
									$("input[name=path]").attr("checked",'0');
								}else{
									
								}
							}					 
						});
					}
				}			
			}
  		);
	}   
	**/
	if($("#changyongyongyu").length > 0){
		$("#changyongyongyu").change(function(){
								if(parseInt($(this).val())  != 0){
									var text = $(this).find("option:selected").text();
									if($("#yijian").text()==''){
										$("#yijian").text($("#yijian").text()+text);
									}else{
										$("#yijian").text($("#yijian").text()+','+text);
									}
									if(text == "退回"){
										$("input[name=path]").attr("checked",'0');
									}else{
										
									}
								}					 
		});
	}
	var _array;
	if(typeof(nodeid)   ==   'undefined'){
		_array = ["请选择","阅","同意","办理完毕","退回"];
		if($("#changyongyongyu").length > 0){		
			for(var i = 0;i<_array.length;i++){
				$("#changyongyongyu").append("<option value='"+i+"'>"+_array[i]+"</option>");   	
			}			
		
		}
	}else{
		var url = Ext.get('basePath').getValue()+'tjsinfo/tjsoa/system/changyongyu.do?nodeId='+nodeid;
		 $.get(url,function(data){		
				if("," == data){
					_array = ["请选择","阅","同意","办理完毕","退回"];
					if($("#changyongyongyu").length > 0){		
						for(var i = 0;i<_array.length;i++){
							$("#changyongyongyu").append("<option value='"+i+"'>"+_array[i]+"</option>");   	
						}			
					
					}
				}else{
					_array = data.split(",");
					if($("#changyongyongyu").length > 0){
						$("#changyongyongyu").append("<option value='0'>请选择</option>");
						for(var i = 0;i<_array.length;i++){
							if("" != _array[i]){
								$("#changyongyongyu").append("<option value='"+i+"'>"+_array[i]+"</option>");
							}							   	
						}			
						
					}
				}			
			}
  		);
	}   
		
}